#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStandardItemModel>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void system_init();
    void run();
    void newSession();
private slots:
    void on_actionQuit_triggered();

    void on_btn_quit_clicked();

    void on_actionopen_new_tab_triggered();

    void on_btn_Session_clicked();

    void on_treeView_doubleClicked(const QModelIndex &index);

    void on_tabWidget_tabCloseRequested(int index);

public slots:
    void new_Serial_Connection(QString portname,int port_BaudRate);

private:
    Ui::MainWindow *ui;
    QStandardItemModel *model;
    QMap<QStandardItem*, int> itemToTabIndexMap;

    QString portname_value;
    int portBaudRate_value;
};
#endif // MAINWINDOW_H
